home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / Localization Tools / Localization using ResEdit™ 3.0 / Plugin for ODF 1 / Plugin for ODF 1.rsrc / VDL_128_Resource.FWmb < prev    next >
Encoding:
Text File  |  1996-12-11  |  9.9 KB  |  403 lines

  1. //========================================================================================
  2. //
  3. // Viwer description for 'FWmb' (ODF menu bar) resources
  4. //
  5. // Author:     Steve Crutchfield
  6. //
  7. // Copyright:  (c) 1996 by Apple Computer, Inc., all rights reserved.
  8. //
  9. //========================================================================================
  10.  
  11. //----------------------------------------------------------------------------
  12. // Definitions for useful script and language code pop-up menus.
  13. // (If ResEdit supported an #include mechanism, this could be
  14. // shared among serveral resource types.)
  15. //----------------------------------------------------------------------------
  16.  
  17. DeclareNamedStatement("ScriptCode")
  18.     Margin(0, 2, 0, 0)
  19.         IntegerPopup("Script:", 53, fScriptCode, Alignment = Left)
  20.             {
  21.                 IntItem("Roman", 0);
  22.                 IntItem("System script", -1);
  23.                 IntItem("Current script", -2);
  24.                 IntItem("Japanese", 1);
  25.                 IntItem("Traditional Chinese", 2);
  26.                 IntItem("Korean", 3);
  27.                 IntItem("Arabic", 4);
  28.                 IntItem("Hebrew", 5);
  29.                 IntItem("Greek", 6);
  30.                 IntItem("Cyrillic", 7);
  31.                 IntItem("Right/Left Symbols", 8);
  32.                 IntItem("Devanagari", 9);
  33.                 IntItem("Gurmukhi", 10);
  34.                 IntItem("Gujarati", 11);
  35.                 IntItem("Oriya", 12);
  36.                 IntItem("Bengali", 13);
  37.                 IntItem("Tamil", 14);
  38.                 IntItem("Telugu", 15);
  39.                 IntItem("Kannada", 16);
  40.                 IntItem("Malayalam", 17);
  41.                 IntItem("Sinhalese", 18);
  42.                 IntItem("Burmese", 19);
  43.                 IntItem("Khmer", 20);
  44.                 IntItem("Thai", 21);
  45.                 IntItem("Laotian", 22);
  46.                 IntItem("Georgian", 23);
  47.                 IntItem("Armenian", 24);
  48.                 IntItem("Simplified Chinese", 25);
  49.                 IntItem("Tibetan", 26);
  50.                 IntItem("Mongolian", 27);
  51.                 IntItem("Geez/Ethiopic", 28);
  52.                 IntItem("East European Roman", 29);
  53.                 IntItem("Vietnamese", 30);
  54.                 IntItem("Extended Arabic", 31);
  55.                 IntItem("Uninterpreted Symbols", 32);
  56.             };
  57.  
  58. DeclareNamedStatement("LanguageCode")
  59.     Margin(0, 2, 0, 0)
  60.         IntegerPopup("Language:", 53, fLanguageCode, Alignment = Left)
  61.             {
  62.                 IntItem("English", 0);
  63.                 IntItem("French", 1);
  64.                 IntItem("German", 2);
  65.                 IntItem("Italian", 3);
  66.                 IntItem("Dutch", 4);
  67.                 IntItem("Swedish", 5);
  68.                 IntItem("Spanish", 6);
  69.                 IntItem("Danish", 7);
  70.                 IntItem("Portuguese", 8);
  71.                 IntItem("Norwegian", 9);
  72.                 IntItem("Hebrew", 10);
  73.                 IntItem("Japanese", 11);
  74.                 IntItem("Arabic", 12);
  75.                 IntItem("Finnish", 13);
  76.                 IntItem("Greek", 14);
  77.                 IntItem("Icelandic", 15);
  78.                 IntItem("Maltese", 16);
  79.                 IntItem("Turkish", 17);
  80.                 IntItem("Croatian", 18);
  81.                 IntItem("TradChinese", 19);
  82.                 IntItem("Urdu", 20);
  83.                 IntItem("Hindi", 21);
  84.                 IntItem("Thai", 22);
  85.                 IntItem("Korean", 23);
  86.                 IntItem("Lithuanian", 24);
  87.                 IntItem("Polish", 25);
  88.                 IntItem("Hungarian", 26);
  89.                 IntItem("Estonian", 27);
  90.                 IntItem("Lettish", 28);
  91.                 IntItem("Latvian", 28);
  92.                 IntItem("Lapponian", 29);
  93.                 IntItem("Lappish", 29);
  94.                 IntItem("Faeroese", 30);
  95.                 IntItem("Farsi", 31);
  96.                 IntItem("Persian", 31);
  97.                 IntItem("Russian", 32);
  98.                 IntItem("SimpChinese", 33);
  99.                 IntItem("Flemish", 34);
  100.                 IntItem("Irish", 35);
  101.                 IntItem("Albanian", 36);
  102.                 IntItem("Romanian", 37);
  103.                 IntItem("Czech", 38);
  104.                 IntItem("Slovak", 39);
  105.                 IntItem("Slovenian", 40);
  106.                 IntItem("Yiddish", 41);
  107.                 IntItem("Serbian", 42);
  108.                 IntItem("Macedonian", 43);
  109.                 IntItem("Bulgarian", 44);
  110.                 IntItem("Ukrainian", 45);
  111.                 IntItem("Byelorussian", 46);
  112.                 IntItem("Uzbek", 47);
  113.                 IntItem("Kazakh", 48);
  114.                 IntItem("Azerbaijani", 49);
  115.                 IntItem("AzerbaijanAr", 50);
  116.                 IntItem("Armenian", 51);
  117.                 IntItem("Georgian", 52);
  118.                 IntItem("Moldavian", 53);
  119.                 IntItem("Kirghiz", 54);
  120.                 IntItem("Tajiki", 55);
  121.                 IntItem("Turkmen", 56);
  122.                 IntItem("Mongolian", 57);
  123.                 IntItem("MongolianCyr", 58);
  124.                 IntItem("Pashto", 59);
  125.                 IntItem("Kurdish", 60);
  126.                 IntItem("Kashmiri", 61);
  127.                 IntItem("Sindhi", 62);
  128.                 IntItem("Tibetan", 63);
  129.                 IntItem("Nepali", 64);
  130.                 IntItem("Sanskrit", 65);
  131.                 IntItem("Marathi", 66);
  132.                 IntItem("Bengali", 67);
  133.                 IntItem("Assamese", 68);
  134.                 IntItem("Gujarati", 69);
  135.                 IntItem("Punjabi", 70);
  136.                 IntItem("Oriya", 71);
  137.                 IntItem("Malayalam", 72);
  138.                 IntItem("Kannada", 73);
  139.                 IntItem("Tamil", 74);
  140.                 IntItem("Telugu", 75);
  141.                 IntItem("Sinhalese", 76);
  142.                 IntItem("Burmese", 77);
  143.                 IntItem("Khmer", 78);
  144.                 IntItem("Lao", 79);
  145.                 IntItem("Vietnamese", 80);
  146.                 IntItem("Indonesian", 81);
  147.                 IntItem("Tagalog", 82);
  148.                 IntItem("MalayRoman", 83);
  149.                 IntItem("MalayArabic", 84);
  150.                 IntItem("Amharic", 85);
  151.                 IntItem("Tigrinya", 86);
  152.                 IntItem("Galla", 87);
  153.                 IntItem("Oromo", 87);
  154.                 IntItem("Somali", 88);
  155.                 IntItem("Swahili", 89);
  156.                 IntItem("Ruanda", 90);
  157.                 IntItem("Rundi", 91);
  158.                 IntItem("Chewa", 92);
  159.                 IntItem("Malagasy", 93);
  160.                 IntItem("Esperanto", 94);
  161.                 IntItem("Welsh", 128);
  162.                 IntItem("Basque", 129);
  163.                 IntItem("Catalan", 130);
  164.                 IntItem("Latin", 131);
  165.                 IntItem("Quechua", 132);
  166.                 IntItem("Guarani", 133);
  167.                 IntItem("Aymara", 134);
  168.                 IntItem("Tatar", 135);
  169.                 IntItem("Uighur", 136);
  170.                 IntItem("Dzongkha", 137);
  171.                 IntItem("JavaneseRom", 138);
  172.                 IntItem("SundaneseRom", 139);
  173.                 IntItem("Unspecified", 32767);
  174.             };
  175.  
  176. DeclareNamedStatement("MenuHeader")
  177.     Margin(5, 5, 0, 0)
  178.         VList()
  179.         {
  180.             HList()
  181.             {
  182.                 StaticText("Class tag: ", Width = 100);
  183.                 StaticText(fClassTag, Width = 50);
  184.  
  185.                 StaticText("Object tag: ", Width = 100);
  186.                 StaticText(fObjectTag, Width = 50);
  187.             }
  188.             
  189.             HList()
  190.             {
  191.                 StaticText("Class ID: ", Width = 100);
  192.                 StaticText(fClassID, Width = 50);
  193.     
  194.                 StaticText("Object ID: ", Width = 100);
  195.                 StaticText(fObjectID, Width = 50);
  196.             }
  197.         
  198.             IntegerPopup("Label:", 53, fLabel, Alignment = Left)
  199.             {
  200.                 IntItem("Pull-down menu", 'pdmn');
  201.             };
  202.             
  203.             Spacer(Height = 3);
  204.         }
  205.  
  206. //----------------------------------------------------------------------------
  207. // ItemHeader and MenuHeader just represent the (slightly different)
  208. // archivable class data headers for items and pull-down menus; 
  209. // they're isolated here for readability.
  210. //----------------------------------------------------------------------------
  211.  
  212. DeclareNamedStatement("ItemHeader")
  213.     Margin(5, 5, 0, 0)
  214.         VList()
  215.         {
  216.             HList()
  217.             {
  218.                 StaticText("Class tag: ", Width = 100);
  219.                 StaticText(fClassTag, Width = 50);
  220.  
  221.                 StaticText("Object tag: ", Width = 100);
  222.                 StaticText(fObjectTag, Width = 50);
  223.  
  224.                 StaticText("OwnerMenuClass: ", Width = 100);
  225.                 StaticText(fOwnerMenuClass, Width = 50);
  226.             }
  227.             
  228.             HList()
  229.             {
  230.                 StaticText("Class ID: ", Width = 100);
  231.                 StaticText(fClassID, Width = 50);
  232.     
  233.                 StaticText("Object ID: ", Width = 100);
  234.                 StaticText(fObjectID, Width = 50);
  235.     
  236.                 StaticText("OwnerMenuID: ", Width = 100);
  237.                 StaticText(fOwnerMenuID, Width = 50);
  238.             }
  239.         
  240.             IntegerPopup("Label:", 53, fLabel, Alignment = Left)
  241.             {
  242.                 IntItem("Text item", 'txit');
  243.                 IntItem("Separator", 'seit');
  244.                 IntItem("Toggle item", 'tgit');
  245.                 IntItem("Submenu", 'suit');
  246.             };
  247.             
  248.             Spacer(Height = 7);
  249.         }
  250.  
  251. //----------------------------------------------------------------------------
  252. // The following statements correspond directly to the appropriate
  253. // ODFRC/EDL data structure.
  254. //----------------------------------------------------------------------------
  255.  
  256. DeclareNamedStatement("TextItem")
  257.     VList(Width = UseParent)
  258.     {
  259.         HList()
  260.         {
  261.             Spacer(Width = 5);
  262.             EditText(fMenuKey, Label = "MenuKey:", LabelWidth = 50, Width = 100);
  263.             Spacer(Width = 25);
  264.             EditText(fCommandID, Label = "CommandID:", Width = 100);
  265.         }
  266.  
  267.         HList()
  268.         {
  269.             Spacer(Width = 5);
  270.             IncludeNamedStatement("ScriptCode");
  271.         }
  272.         
  273.         HList()
  274.         {
  275.             Spacer(Width = 5);
  276.             IncludeNamedStatement("LanguageCode");
  277.         }
  278.         
  279.         Margin(5, 2, 0, 0)
  280.             EditText(fTitle, Label = "Item Text:", LabelWidth = 50);
  281.     }
  282.     
  283. DeclareNamedStatement("ToggleItem")
  284.     VList(Width = UseParent)
  285.     {
  286.         IncludeNamedStatement("TextItem");
  287.         
  288.         Spacer(Height = 5);
  289.         
  290.         DynamicVList(fAlternateItem, MenuItem)
  291.             VList()
  292.             {
  293.                 HList()
  294.                 {
  295.                     Spacer(Width = 5);
  296.                     IncludeNamedStatement("ScriptCode");
  297.                 }
  298.                 
  299.                 HList()
  300.                 {
  301.                     Spacer(Width = 5);
  302.                     IncludeNamedStatement("LanguageCode");
  303.                 }
  304.         
  305.                 Margin(5, 2, 0, 0)
  306.                     EditText(fTitle, Label = "OtherText:", LabelWidth = 50);
  307.             }
  308.     }
  309.  
  310. DeclareNamedStatement("SubMenu")
  311.     VList(Width = UseParent)
  312.     {
  313.         Margin(5, 0, 0, 0)
  314.             StaticText("Submenu:");
  315.         
  316.         DynamicVList(fSubMenu, SubMenu, Width = UseParent)
  317.             Switch(fLabel)
  318.             {
  319.                 case 'pdmn':
  320.                     SELF
  321.                 
  322.                 default:
  323.                     StaticText("### expected 'pdmn' here");
  324.             }
  325.     }
  326.  
  327. DeclareNamedStatement("PullDownMenu")
  328.     Margin(5, 5, 5, 20)
  329.     VList(Width = UseParent)
  330.     {
  331.         IncludeNamedStatement("MenuHeader");
  332.         
  333.         Spacer(Height = 5);
  334.         
  335.         HList(Width = 350)
  336.         {
  337.             StaticText("Menu: ");
  338.             EditText(fTitle);
  339.         }
  340.  
  341.         Spacer(Height = 5);
  342.     
  343.         DynamicListMargin(fTitle, fItems, Width = UseParent)
  344.             DynamicVList(fItems, Item, Width = UseParent)
  345.                 Margin(0, 2, 0, 2)
  346.                     Margin(5, 5, 5, 5, Single)
  347.                         VList(Width = UseParent)
  348.                         {
  349.                             
  350.                             HList()
  351.                             {
  352.                                 StaticText("Item #");
  353.                                 StaticText(ContextElementIndex);
  354.                                 StaticText(": ");
  355.                             }
  356.         
  357.                             IncludeNamedStatement("ItemHeader");
  358.                             
  359.                             Switch(fLabel)
  360.                             {
  361.                                 case 'txit':
  362.                                     IncludeNamedStatement("TextItem");
  363.                                     
  364.                                 case 'tgit':
  365.                                     IncludeNamedStatement("ToggleItem");
  366.                                 
  367.                                 case 'seit':
  368.                                     Margin(20, 5, 5, 5)
  369.                                         StaticText("--- separator ---");
  370.                                 
  371.                                 case 'suit':
  372.                                     IncludeNamedStatement("SubMenu");
  373.                                     
  374.                                 default:
  375.                                     StaticText("### expected item class tag here");
  376.                             }
  377.                             
  378.                             Spacer(Height = 5);
  379.                         }
  380.         
  381.         Spacer(Height = 5);
  382.     }
  383.  
  384. DeclareNamedStatement("MenuBar")        
  385.     DynamicVList(fMenus, Menu, Width = UseParent)
  386.         IncludeNamedStatement("PullDownMenu");
  387.  
  388. //----------------------------------------------------------------------------
  389. // Main statement.
  390. //----------------------------------------------------------------------------
  391.  
  392. Switch(fLabel)
  393. {
  394.     case 'root':
  395.         IncludeNamedStatement("MenuBar");
  396.             
  397.     case 'pdmn':
  398.         IncludeNamedStatement("PullDownMenu");
  399.     
  400.     default:
  401.         StaticText("### expected 'root' or 'pdmn' here");
  402. }
  403.